import request from '../index';

const baseUrl = '/base-server';
const financeUrl = '/finance-server';
export const URL_QUERYCOMPANYLIST = `${baseUrl}/org/queryCompanyList`;
export const URL_PAGINGACCOUNTFLOW = `${financeUrl}/account/pagingAccountFlow`;
// 查询企业信息列表
export const queryCompanyList = (params: any, pages: any) => {
  return request({
    url: `${baseUrl}/org/queryCompanyList`,
    params: { form: params, pages: pages },
  });
};

// 新增企业信息
export const addCompany = (params: any) => {
  return request({
    url: `${baseUrl}/org/addCompany`,
    params: { form: params, successMsg: '1' },
  });
};

// 查询所有企业
// export const queryAllCompany = (params: any) => {
//   return request({
//     url: `${baseUrl}/org/queryAllCompany`,
//     params: { form: params },
//   });
// };

// 修改企业信息
export const updateCompany = (params: any) => {
  return request({
    url: `${baseUrl}/org/updateCompany`,
    params: { form: params, successMsg: '1' },
  });
};

// 查询企业信息详细列表
export const queryCompanyDetail = (params: any) => {
  return request({
    url: `${baseUrl}/org/queryCompanyDetail`,
    params: { form: params },
  });
};

// 查询企业信息详细列表
export const queryOrgDetail = (params: any) => {
  return request({
    url: `${baseUrl}/org/queryOrgDetail`,
    params: { form: params },
  });
};

// 逻辑删企业单个信息
export const deleteCompany = (params: any) => {
  return request({
    url: `${baseUrl}/org/deleteCompany`,
    params: { form: params, successMsg: '2' },
  });
};

// 冻结账号
export const frozenCompany = (params: any) => {
  return request({
    url: `${baseUrl}/org/frozenCompany`,
    params: { form: params, successMsg: '2' },
  });
};

// 分页查询账户流水
export const pagingAccountFlow = (params: any, pages: any) => {
  return request({
    url: `${financeUrl}/account/pagingAccountFlow`,
    params: { form: params, pages: pages },
  });
};

// 导出企业账户流水
export const EXPORT_ACCOUNTFLOW = `${financeUrl}/account/exportAccountFlow`;


// 查询账户信息
export const getAccount = (params: any) => {
  return request({
    url: `${financeUrl}/account/getAccount`,
    params: { form: params },
  });
};

// 账户变更
export const changeAccount = (params: any) => {
  return request({
    url: `${financeUrl}/account/change`,
    params: { form: params, successMsg: '2' },
  });
};
